package com.guigu.tms.commons.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 机构业务范围表
 * </p>
 *
 * @author zwj
 * @since 2022-10-03
 */
@TableName("pd_agency_scope")
@Data
public class AgencyScope implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    /**
     * 机构id
     */
    private String agencyId;

    /**
     * 行政区域id
     */
    private String areaId;

    /**
     * 机构作业范围
     */
    private String mutiPoints;

    @TableField(exist = false)
    private List<List<Map>> mutiPointList;


    public List<List<Map>> getMutiPointList() {
//        if(StringUtils.isEmpty(this.mutiPoints)){
//            return null;
//        }
//        ObjectMapper objectMapper = new ObjectMapper();
//        try {
//            return objectMapper.readValue(this.mutiPoints,List.class);
//        } catch (JsonProcessingException e) {
//            e.printStackTrace();
//            return null;
//        }
        return null;
    }

    public void setMutiPointList(List<List<Map>> mutiPointList) {
        this.mutiPointList = mutiPointList;
    }
}
